package com.cn.learn.jpa.domain.jpa;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Set;

/**
 * @ClassName GameFeature
 * @Description 游戏特点类
 * @Author JiJiang
 * @Date 2022/9/22 19:43
 * @Version 1.0
 */

@Table(name = "game_feature") //设置表的名字
@Entity //标记为实体类
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GameFeature {


    @Id //设置该属性为id 即数据库中的key
    @GeneratedValue(strategy = GenerationType.IDENTITY) //设置id的生成策略为自动生成
    @Column(name = "feature_id")
    private Long featureId;


    @Column(name = "featureName")
    private Long featureName;



    //多对多关系映射
    @ManyToMany(mappedBy="gameFeatures")
    private Set<Game> games;

}
